import axios from '@/ajax/config'
import { id } from 'element-plus/es/locale'

/**
 * @param param
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */


// 短信群发-新建群发
export function createMass(params: any) {
  return axios.post('/scrm-api/sms/mass/create', params)
}

// 短信群发-群发列表
export function getMassList(params: any) {
  return axios.post('/scrm-api/sms/mass/list', params)
}

// 短信群发-删除群发
export function delMass(params: any) {
  return axios.post('/scrm-api/sms/mass/del', params)
}

// 下载短信群发模板
export function downloadMassTemplate() {
  return axios.get('/scrm-api/sms/mass/get-template')
}

// 短信群发结果
export function getMassRecord(params: any) {
  return axios.get('/scrm-api/sms/mass/record', params)
}

// 人群包-全部人群包列表
export function getPackageListAll(params: any) {
  return axios.get('/scrm-api/sms/crowd/package/getList', params)
}

// 根据文件解析有效手机号的数量
export function calculateValidNumber(params: any) {
  return axios.post('/scrm-api/sms/calculate/valid', params)
}

// 导出短信群发结果
export function downLoadMassRecord(params: any) {
  return axios.get('/scrm-api/sms/mass/export-record', params)
}

// 分组-获取分组列表
export function getGroupListAll() {
  return axios.get('/scrm-api/sms/group/list', {
    page: 1,
    'per-page': 999,
    type: 100
  })
}

// 单短信模板-获取模板列表
export function getTemplateListAll(id: string | number) {
  return axios.get('/scrm-api/sms/template/getList', {
    group_id: id,
    state: 2,
    page: 1,
    page_size: 999
  })
}

// 选择员工
export function getUserSelectList() {
  return axios.get('/scrm-api/sms/user/select')
}
